|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.omg.CORBA.portable.ObjectImpl | +--org.omg.CORBA.DynamicImplementation | +--ChatApp._ChatClientImplBase | +--ChatApp.ChatClientServant
ChatClientServant is the main object of a ChatClient in the secured CHat Application. This object is in charge of the registration and messaging of the client to the server and other registered client All the encryption and decryption is done by this class leaving the gui to handle only the communication with the CORBA naming service. The Methods marked as remote methods are invoked by the remote ChatRegistryServant. Other methods are invoked by the application gui.
Constructor Summary | |
ChatClientServant()
Empty constructor when no gui is used |
|
ChatClientServant(MyChatApp app)
Cunstructs a ChatClientServant for a specific gui. |
Method Summary | |
void |
ackRegister(short ackType)
Remote methode for acknowledging the registration. |
void |
broadcastMessage(java.lang.String message,
java.lang.String clientID,
ChatRegistry ref)
Broadcast a message to all other registered clients by encrypting the original message with the server's session key and remotely invoke the broadcast method on the remote ChatRegistry object |
void |
clientAdded(java.lang.String clientID)
Remote method. |
void |
clientRemoved(java.lang.String clientID)
Remote Method. |
void |
printMessage(byte[] Message,
java.lang.String sourceID)
Remote method. |
void |
printPrivateMessage(byte[] Message,
java.lang.String SourceID)
Remote method. |
void |
registerToServer(java.lang.String clientID,
ChatRegistry ref)
Register this client to the server by encrypting his client ID and remotely invoke the server's register method. |
void |
sendPrivateMessage(java.lang.String message,
java.lang.String sourceID,
java.lang.String destID,
ChatRegistry ref)
Send a private message to another registered client by encrypting the message, the sender's ID and the receiver's ID with the server's PKCS public key (so other registered users can't decrypt) and remotely invoke the sendPrivateMessage on the ChatRegistry remote object |
void |
unregisterFromServer(java.lang.String clientID,
ChatRegistry ref)
UnRegister this client to the server by encrypting his client ID and remotely invoke the server's unregister method. |
Methods inherited from class ChatApp._ChatClientImplBase |
_ids,
invoke |
Methods inherited from class org.omg.CORBA.portable.ObjectImpl |
_create_request,
_create_request,
_duplicate,
_get_delegate,
_get_domain_managers,
_get_interface_def,
_get_policy,
_hash,
_invoke,
_is_a,
_is_equivalent,
_is_local,
_non_existent,
_orb,
_release,
_releaseReply,
_request,
_request,
_servant_postinvoke,
_servant_preinvoke,
_set_delegate,
_set_policy_override,
equals,
hashCode,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ChatClientServant()
public ChatClientServant(MyChatApp app)
app
- The application gui of the ChatClient.Method Detail |
public void ackRegister(short ackType)
ackType
- acknowledge type. For future implementations. Not used in this version.public void printMessage(byte[] Message, java.lang.String sourceID)
encMessage
- The encrypted message, encrypted by the server's session keysourceID
- the sender's IDpublic void printPrivateMessage(byte[] Message, java.lang.String SourceID)
encMessage
- The encrypted message, encrypted with the client public PKCS keyencSourceID
- The encrypted sender's ID, encrypted by the client public PKCS keypublic void clientAdded(java.lang.String clientID)
public void clientRemoved(java.lang.String clientID)
public void registerToServer(java.lang.String clientID, ChatRegistry ref)
clientID
- The unencrypted registering client IDref
- a remote object represents the ChatRegistrypublic void unregisterFromServer(java.lang.String clientID, ChatRegistry ref)
clientID
- The unencrypted unregistering client IDref
- a remote object represents the ChatRegistrypublic void broadcastMessage(java.lang.String message, java.lang.String clientID, ChatRegistry ref)
message
- The original, unencrypted messageclientID
- The sender's IDref
- a remote object represents the ChatRegistrypublic void sendPrivateMessage(java.lang.String message, java.lang.String sourceID, java.lang.String destID, ChatRegistry ref)
message
- The original unencrypted messagesourceID
- The sender's unencrypted IDdestID
- The receiver's unencrypted IDref
- a remote object represents the ChatRegistry
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |